package com.springboot.controller;


import com.springboot.model.PatientInfoForm;
import com.springboot.service.AssistantSeePatientDetailService;
import com.springboot.service.UserLoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 本控制台用于助理查看患者信息
 */
@Controller
public class AssistantSeePatientDetail {
    @Autowired
    UserLoginService userLoginService;
    @Autowired
    AssistantSeePatientDetailService assistantSeePatientDetailService;

    @CrossOrigin
    @RequestMapping(value = "/seePatientDetails")
    public @ResponseBody
    String assistantSeePatientDetails(@RequestParam("bootId") Integer bootId)
    {
        System.out.println("查看患者信息");
        try{
            PatientInfoForm patientInfoForm=new PatientInfoForm();
            patientInfoForm=assistantSeePatientDetailService.getPatientDetailById(bootId);
            return patientInfoForm.toString1();
        }
        catch (Exception e)
        {
            return "查找失败";
        }
    }



}
